﻿using SPSAndong.UserControll;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SPSAndong.Forms
{
    public partial class FrmAndong : UIPage
    {
        bool isLoad = true;      //判断窗体是否首次加载
        ExceptionCallShow exceptionCallShow1;
        ExceptionCallShow exceptionCallShow2;
        ExceptionCallShow exceptionCallShow3;
        ExceptionCallShow exceptionCallShow4;

        public FrmAndong()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 窗体加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmAndong_Load(object sender, EventArgs e)
        {
            //如果窗体已经加载过则不重新加载
            if (!isLoad)
                return;
            isLoad = false;
            //注册窗体注销事件
            this.Disposed += FrmAndong_Disposed;
            this.exceptionCallShow1 = new ExceptionCallShow(new int[1] { 1});
            this.exceptionCallShow2 = new ExceptionCallShow(new int[1] { 2 });
            this.exceptionCallShow3 = new ExceptionCallShow(new int[2] { 3,4 });
            this.exceptionCallShow4 = new ExceptionCallShow(new int[1] { 5 });
            //
            this.tableLayoutPanel1.Controls.Add(this.exceptionCallShow1, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.exceptionCallShow2, 1, 1);
            this.tableLayoutPanel1.Controls.Add(this.exceptionCallShow3, 0, 3);
            this.tableLayoutPanel1.Controls.Add(this.exceptionCallShow4, 1, 3);
        }
        /// <summary>
        /// 窗体销毁
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmAndong_Disposed(object sender, EventArgs e)
        {
            this.exceptionCallShow1.Dispose();
            this.exceptionCallShow2.Dispose();
            this.exceptionCallShow3.Dispose();
            this.exceptionCallShow4.Dispose();
        }
    }
}
